<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<script type="text/javascript">
function myShopFormCheck(){
	
		if($("#shopName").val()==''){
			alert("쇼핑몰명은 필수 사항입니다.");
			$("#shopName").focus();
			return;
		}
		if(($("#shopManagerName").val()=='')){
			alert("관리자명은 필수 사항입니다.");
			$("#shopManagerName").focus();
			return;
		}
		if(($("#shopId").val()=='')){
			alert("상점 ID는 필수 사항입니다.");
			$("#shopId").focus();
			return;
		}
		if($("#shopManagerEmail").val()==''){
			alert("관리자 E-Mail는 필수 사항입니다.");
			$("#shopManagerEmail").focus();
			return;
		}
		if($("#shopManagerTel").val()==''){
			alert("관리자 휴대전화는 필수 사항입니다.");
			$("#shopManagerTel").focus();
			return;
		}
		if($("#shopDomain").val()==''){
			alert("상점대표 도메인은 필수 사항입니다.");
			$("#shopDomain").focus();
			return;
		}
		if($("#corporationRegistNum").val()==''){
			alert("사업자등록번호는 필수 사항입니다.");
			$("#corporationRegistNum").focus();
			return;
		}
		if($("#corporationName").val()==''){
			alert("상호(법인명)는 필수 사항입니다.");
			$("#corporationName").focus();
			return;
		}
		if($("#shopAdd").val()==''){
			alert("사업장 주소는 필수 사항입니다.");
			$("#shopAdd").focus();
			return;
		}
		if($("#shopTel").val()==''){
			alert("대표 전화번호는 필수 사항입니다.");
			$("#shopTel").focus();
			return;
		}
		if($("#shopFax").val()==''){
			alert("대표 팩스는 필수 사항입니다.");
			$("#shopFax").focus();
			return;
		}
		if($("#shopEmail").val()==''){
			alert("대표 E-Mail은 필수 사항입니다.");
			$("#shopEmail").focus();
			return;
		}
		if($("#counselTel").val()==''){
			alert("상담/주문 전화는 필수 사항입니다.");
			$("#counselTel").focus();
			return;
		}
		if($("#counselEmail").val()==''){
			alert("상담/주문 E-mail은 필수 사항입니다.");
			$("#counselEmail").focus();
			return;
		}
		if($("#counselFax").val()==''){
			alert("팩스번호는 필수 사항입니다.");
			$("#counselFax").focus();
			return;
		}
		
		$.ajax({
			url:"/${initParam.context_root}/myshop/registerMyShop.do",
			type:"POST",
			data:$("#myShopForm").serialize(),
			dataType:"JSON",
			success:function(JSON){
				if(JSON.success==1){
					alert("등록이 완료되었습니다.");
				}else if(JSON.success==-1){
					alert("변경되었습니다.");
				}else{
					alert("실패");
				}
			}
		});
}
</script>

<br><br>
<form id="myShopForm" method="post" style="width: 500px;" >
<table class="table table-bordered" border="1" style="border-collapse:collapse; border-color:#BDBDBD; margin-left: 200px;">
	<tr style="background-color:#453949; color: white;" >
		<td  colspan='2' align="center">기본정보 설정</td>
	</tr>
	<tr>
		<td style="width: 200px;">쇼핑몰명</td><td style="width: 300px;"><input type="text" id="shopName" name="shopName" placeholder="${requestScope.myshop.shopName }"></td>
	</tr>
	<tr>
		<td >관리자명</td><td><input type="text" id="shopManagerName" name="shopManagerName" placeholder="${requestScope.myshop.shopManagerName }"></td>
	</tr>
	<tr>
		<td>상점 아이디</td><td><input type="text" id="shopId" name="shopId" placeholder="${requestScope.myshop.shopId }"></td>
	</tr>
	<tr>
		<td>관리자 E-Mail</td><td><input type="text" id="shopManagerEmail" name="shopManagerEmail" placeholder="${requestScope.myshop.shopManagerEmail }"></td>
	</tr>
	<tr>
		<td>관리자 휴대전화</td><td><input type="text" id="shopManagerTel" name="shopManagerTel" placeholder="${requestScope.myshop.shopManagerTel }"></td>
	</tr>
	<tr>
		<td>상점대표 도메인</td><td><input type="text" id="shopDomain" name="shopDomain" placeholder="${requestScope.myshop.shopDomain }"></td>
	</tr>
	<tr>
		<td>사업자등록번호</td><td><input type="text" id="corporationRegistNum" name="corporationRegistNum" placeholder="${requestScope.myshop.corporationRegistNum }"></td>
	</tr>
	<tr>
		<td>상호(법인명)</td><td><input type="text" id="corporationName" name="corporationName" placeholder="${requestScope.myshop.corporationName }"></td>
	</tr>
	<tr>
		<td>사업장 주소</td><td><input type="text" id="shopAdd" name="shopAdd" placeholder="${requestScope.myshop.shopAdd }"></td>
	</tr>
	<tr>
		<td>대표 전화번호</td><td><input type="text" id="shopTel" name="shopTel" placeholder="${requestScope.myshop.shopTel }"></td>
	</tr>
	<tr>
		<td>대표 팩스</td><td><input type="text" id="shopFax" name="shopFax" placeholder="${requestScope.myshop.shopFax }"></td>
	</tr>
	<tr>
		<td>대표 E-Mail</td><td><input type="text" id="shopEmail" name="shopEmail" placeholder="${requestScope.myshop.shopEmail }"></td>
	</tr>
	<tr style="background-color:#453949; color: white;">
		<td colspan='2' align="center">고객상담센터정보</td>
	</tr>
	<tr>
			<td>상담/주문 전화</td><td><input type="text" id="counselTel" name="counselTel" placeholder="${requestScope.myshop.counselTel }"></td>
		</tr>
		<tr>
			<td>상담/주문 E-mail</td><td><input type="text" id="counselEmail" name="counselEmail" placeholder="${requestScope.myshop.counselEmail }"></td>
		</tr>
		<tr>
			<td>팩스번호</td><td><input type="text" id="counselFax" name="counselFax" placeholder="${requestScope.myshop.counselFax }"></td>
		</tr>
		<tr>
			<td>SMS 수신번호</td><td><input type="text" id="smsNum" name="smsNum" placeholder="${requestScope.myshop.smsNum }"></td>
		</tr>
		<tr>
			<td>CS 운영시간</td><td><input type="text" id="cSOperationTime" name="cSOperationTime" placeholder="${requestScope.myshop.cSOperationTime }"></td>
		</tr>
		<tr>
			<td colspan="2" align="center"><input type="button" value="내쇼핑몰정보등록" onclick="myShopFormCheck()"></td>
		</tr>
</table>
</form>
